package com.umeng.analytics.game;

import android.content.Context;

import com.umeng.analytics.MobclickAgent;
import com.umeng.analytics.pro.by;
import com.umeng.analytics.social.UMPlatformData;
import com.umeng.analytics.social.UMSocialService;
import com.umeng.analytics.social.d;

public class UMGameAgent extends MobclickAgent {
    private static final String a = "Input string is null or empty";
    private static final String b = "Input string must be less than 64 chars";
    private static final String c = "Input value type is negative";
    private static final String d = "The int value for \'Pay Channels\' ranges between 1 ~ 99 ";
    private static final c e = new c();
    private static Context f;

    public UMGameAgent() {

    }

    private static boolean a(String arg2) {
        boolean v0 = true;
        if (arg2 != null && arg2.trim().length() > 0) {
            v0 = false;
        }

        return v0;
    }

    public static void bonus(double arg2, int arg4) {
        if (arg2 < 0) {
            by.e("Input value type is negative");
        } else {
            if (arg4 > 0 && arg4 < 100) {
                UMGameAgent.e.a(arg2, arg4);
                return;
            }

            by.e("The int value for \'Pay Channels\' ranges between 1 ~ 99 ");
        }
    }

    public static void bonus(String arg8, int arg9, double arg10, int arg12) {
        if (UMGameAgent.a(arg8)) {
            by.e("Input string is null or empty");
        } else {
            if (arg9 >= 0 && arg10 >= 0) {
                if (arg12 > 0 && arg12 < 100) {
                    UMGameAgent.e.a(arg8, arg9, arg10, arg12);
                    return;
                }

                by.e("The int value for \'Pay Channels\' ranges between 1 ~ 99 ");
                return;
            }

            by.e("Input value type is negative");
        }
    }

    public static void buy(String arg2, int arg3, double arg4) {
        if (UMGameAgent.a(arg2)) {
            by.e("Input string is null or empty");
        } else {
            if (arg3 >= 0 && arg4 >= 0) {
                UMGameAgent.e.a(arg2, arg3, arg4);
                return;
            }

            by.e("Input value type is negative");
        }
    }

    public static void exchange(double arg8, String arg10, double arg11, int arg13, String arg14) {
        double v2 = 0;
        if (arg8 < v2 || arg11 < v2) {
            by.e("Input value type is negative");
        } else {
            if (arg13 > 0 && arg13 < 100) {
                UMGameAgent.e.a(arg8, arg10, arg11, arg13, arg14);
                return;
            }

            by.e("The int value for \'Pay Channels\' ranges between 1 ~ 99 ");
        }
    }

    public static void failLevel(String arg2) {
        if (UMGameAgent.a(arg2)) {
            by.e("Input string is null or empty");
        } else if (arg2.length() > 64) {
            by.e("Input string must be less than 64 chars");
        } else {
            UMGameAgent.e.d(arg2);
        }
    }

    public static void finishLevel(String arg2) {
        if (UMGameAgent.a(arg2)) {
            by.e("Input string is null or empty");
        } else if (arg2.length() > 64) {
            by.e("Input string must be less than 64 chars");
        } else {
            UMGameAgent.e.c(arg2);
        }
    }

    public static void init(Context arg1) {
        UMGameAgent.e.a(arg1);
        UMGameAgent.f = arg1.getApplicationContext();
    }

    public static void onEvent(String arg1, String arg2) {
        UMGameAgent.onEvent(UMGameAgent.f, arg1, arg2);
    }

    public static void onSocialEvent(Context arg1, String arg2, UMPlatformData[] arg3) {
        if (arg1 == null) {
            by.e("context is null in onShareEvent");
        } else {
            com.umeng.analytics.social.d.d = "4";
            UMSocialService.share(arg1, arg2, arg3);
        }
    }

    public static void onSocialEvent(Context arg1, UMPlatformData[] arg2) {
        if (arg1 == null) {
            by.e("context is null in onShareEvent");
        } else {
            com.umeng.analytics.social.d.d = "4";
            UMSocialService.share(arg1, arg2);
        }
    }

    public static void pay(double arg8, double arg10, int arg12) {
        double v2 = 0;
        if (arg12 <= 0 || arg12 >= 100) {
            by.e("The int value for \'Pay Channels\' ranges between 1 ~ 99 ");
        } else {
            if (arg8 >= v2 && arg10 >= v2) {
                UMGameAgent.e.a(arg8, arg10, arg12);
                return;
            }

            by.e("Input value type is negative");
        }
    }

    public static void pay(double arg12, String arg14, int arg15, double arg16, int arg18) {
        double v4 = 0;
        if (arg18 <= 0 || arg18 >= 100) {
            by.e("The int value for \'Pay Channels\' ranges between 1 ~ 99 ");
        } else {
            if (arg12 >= v4 && arg15 >= 0 && arg16 >= v4) {
                if (UMGameAgent.a(arg14)) {
                    by.e("Input string is null or empty");
                } else {
                    UMGameAgent.e.a(arg12, arg14, arg15, arg16, arg18);
                }

                return;
            }

            by.e("Input value type is negative");
        }
    }

    public static void setPlayerLevel(int arg2) {
        UMGameAgent.e.a(String.valueOf(arg2));
    }

    public static void setTraceSleepTime(boolean arg1) {
        UMGameAgent.e.a(arg1);
    }

    public static void startLevel(String arg2) {
        if (UMGameAgent.a(arg2)) {
            by.e("Input string is null or empty");
        } else if (arg2.length() > 64) {
            by.e("Input string must be less than 64 chars");
        } else {
            UMGameAgent.e.b(arg2);
        }
    }

    public static void use(String arg2, int arg3, double arg4) {
        if (UMGameAgent.a(arg2)) {
            by.e("Input string is null or empty");
        } else {
            if (arg3 >= 0 && arg4 >= 0) {
                UMGameAgent.e.b(arg2, arg3, arg4);
                return;
            }

            by.e("Input value type is negative");
        }
    }
}

